The reason lies in the fact that “correct” carries a more judgmental connotation, while “yes” is relatively milder. From a young age, we are educated to see things in black and white; correct is 1, wrong is 0, completely correct is 100, and completely wrong is 0. When there is no obvious superior-subordinate or mentor-student relationship in a conversation, using “correct” as a habitual phrase may cause slight dissatisfaction in others, even though this dissatisfaction may not be expressed or spoken out loud. “Why are you judging my correctness so naturally?” Such thoughts might linger, albeit fleetingly, only to be forgotten shortly thereafter.
Another reason is that responses like “correct” often occur in questions phrased as “Is…?” or “Isn’t it…?” “Is int a basic type in Java?” “Correct” “Isn’t int a basic type in Java?” “Correct” This seems like a normal conversation, but why should “correct” be used to answer these questions? More amusingly, if the answer is negative, the response often becomes “no” instead of “incorrect.” Some people’s speech lacks any logical consistency.
Perhaps the support for saying “correct” is that it can bring a slight sense of recognition; hearing “correct” in response makes one feel acknowledged. In fact, outstanding individuals do not need such recognition.
Similarly, there is also a subtle difference between “okay” and “fine” in common spoken language, and so on.